//
//  NSURLSessionController.m
//  httpDemo
//
//  Created by yuzhanjie on 2018/4/30.
//  Copyright © 2018年 yuzhanjie. All rights reserved.
//

#import "NSURLSessionController.h"

@interface NSURLSessionController ()<NSURLSessionDelegate>

@end

@implementation NSURLSessionController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

//NSURLSession的实现方法与NSURLConnection类似，只是要求授权证明的回调不一样而已
- (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task  didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential * __nullable credential))completionHandler {
    //步骤与NSURLConnection回调方法一致
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
